package com.primb.androidlibs.update.entity;


import com.primb.androidlibs.update.model.LibraryUpdateEntity;

/**
 * Created by Chen on 2017/6/19.
 * 功能描述：
 */

public class AppUpdateEntity implements LibraryUpdateEntity {

    /**
     * version :
     * downloadUrl :
     * updateLog :
     */

    private String version;
    private String downloadUrl;
    private String updateLog;
    private int isForceUpdate = 2;
    private String size;

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getDownloadUrl() {
        return downloadUrl;
    }

    public void setDownloadUrl(String downloadUrl) {
        this.downloadUrl = downloadUrl;
    }

    public String getUpdateLog() {
        return updateLog;
    }

    public void setUpdateLog(String updateLog) {
        this.updateLog = updateLog;
    }

    public int getIsForceUpdate() {
        return isForceUpdate;
    }

    public void setIsForceUpdate(int isForceUpdate) {
        this.isForceUpdate = isForceUpdate;
    }

    public String getSize() {
        return size;
    }

    public void setSize(String size) {
        this.size = size;
    }

    @Override
    public int obtainVersionCodes() {
        try {
            return Integer.valueOf(getVersion());
        } catch (NumberFormatException e) {
            return 0;
        }
    }

    @Override
    public int obtainIsForceUpdates() {
        return getIsForceUpdate();
    }

    @Override
    public String obtainDownUrls() {
        return getDownloadUrl();
    }

    @Override
    public String obtainUpdateLogs() {
        return getUpdateLog();
    }

    @Override
    public String getApkSizes() {
        return getSize();
    }
}
